package test;


import java.util.ArrayList;
import java.util.List;

/**
 * @author lizhichuan
 * @date 2024/7/3 11:51
 */
public class TreeExample {
    public static void main(String[] args) {
        // 创建树节点示例
        TreeNode phaseNode = new TreeNode("phase1", "阶段1", "阶段", null);
        TreeNode categoryNode = new TreeNode("category1", "分类1", "校验分类", "phase1");
        TreeNode checkNode = new TreeNode("check1", "对象1", "校验对象", "category1");

        phaseNode.addChild(categoryNode);
        categoryNode.addChild(checkNode);

        // 假设的日志列表
        List<LogEntry> logs = new ArrayList<>();
        logs.add(new LogEntry("check1", "使能", null)); // 示例日志，启用check1
        logs.add(new LogEntry("check1", "状态", "成功")); // 示例日志，check1状态成功

        // 更新树状态
        phaseNode.updateStatusFromLogs(logs);

        // 打印或进一步处理更新后的树结构
    }
}
